/*
 * @Author       : WLN
 * @Date         : 2023-02-20 09:37:37
 * @LastEditTime : 2023-02-20 11:25:21
 * @LastEditors  : WLN
 * @FilePath     : \AdminStration\src\Common\Login\index.jsx
 * @Description  :
 */
import '../Scss/BeiMoLoginPage.scss'
import { lazy, Suspense, useState } from 'react'
import { commonUrl } from '../../Configure/CommonParameter'
import { v4 as uuidv4 } from 'uuid'
import { PlugInUnit } from '../PlugInUnit'
const SignUp = lazy(() => import('../SignUp'))
const CodeUp = lazy(() => import('../CodeUp'))

const BeiMoLoginPage = ({ imageUrl, codeState, uuid }) => {
    const [QRUuid] = useState(uuidv4())
    return (
        <Suspense>
            <div className="BeiMoLoginPage">
                <img className="LoginBack" src={`${imageUrl}login_background.png`} alt="" />
                <div className="top">
                    <img src={`${imageUrl}login_texttitle.png`} alt="" />
                </div>
                <img className="bottom" src={`${imageUrl}login_under.png`} alt="" />

                <div className="LoginBox">
                    <img className="LoginBoxBack" src={`${imageUrl}login_box.png`} alt="" />

                    <div className="SingUp">
                        {codeState ? (
                            <CodeUp
                                codeState={codeState}
                                codeStyle={commonUrl + 'code.css'}
                                QRUuid={QRUuid}
                                ProjectUuid={uuid}
                            />
                        ) : (
                            <SignUp />
                        )}
                        <PlugInUnit />
                    </div>
                </div>
            </div>
        </Suspense>
    )
}
export default BeiMoLoginPage
